import os
from google.appengine.api import users
from google.appengine.ext.webapp import template
from google.appengine.ext import webapp
from google.appengine.ext import db
from imphandler import *
from sheet_model import Sheet
from sheet_model import SheetItem

class SheetEdit_AddItem(ImpHandler):
	def processRequest(self):
		sKey = self.request.get('key')
		if(not sKey):
			return False
		newItem = SheetItem()
		newItem.sheet = db.get(sKey)
		newItem.value = "new item"
		newItem.put()
		self.response.out.write(newItem.key())

	def notAuthenticated(self):
		self.response.status = 403
